<?php 
    $show_status = C('Common.show_status');
    $groups      = C('APP_GROUP_ARRAY');
?>
<body style="width:450px;" class="body_none">
<div class="pop_cont pop_table">
<!--添加节点-->
    <div class="h_a">添加节点</div>
    <form class="J_ajaxForm" data-role="list" action="<?php echo U('Admin/Node/add'); ?>" method="post" >
        <?php if(isset($node['root_id'])): ?>
            <?php if($node['root_id']==0): ?>
            <input type="hidden" name ="root_id" value="<?php echo $node['id']; ?>">
            <?php else: ?>
            <input type="hidden" name ="root_id" value="<?php echo $node['root_id']; ?>">
            <?php endif; ?>
        <?php else: ?>
        <input type="hidden" name ="root_id" value="0">
        <?php endif; ?>
        
        <?php if(isset($node['parent_id'])): ?>
            <input type="hidden" name ="parent_id" value="<?php echo $node['id']; ?>">
        <?php else: ?>
        <input type="hidden" name ="parent_id" value="0">
        <?php endif; ?>
        
        <?php if(isset($_GET['root']) && $_GET['root']==1): ?>
        <input type="hidden" name ="root_flg" value="1">
        <?php endif; ?>
        <input type="hidden" name ="type" value="<?php echo isset($node['type'])?$node['type']:''; ?>">
            <div class="table_full">
              <table width="100%" class="table_form">
                <tr>
                  <th width="80">节点名称：</th>
                  <td><input type="text" name="name" id="name" class="input length_3"></td>
                </tr>
                
                <tr>
                  <th>所属分组：</th>
                  <td>
                    <select name="g" class="select_2">
                        <?php if(empty($_GET['root'])): ?>
                        <option value=""></option>
                        <?php endif; ?>
                        <?php foreach($groups as $key=>$val): ?>
                        <option value="<?php echo $val;?>"<?php if(isset($node['g']) && $node['g'] == $val) echo ' selected'; ?>><?php echo $val;?></option>
                        <?php endforeach; ?>
                    </select>
                  </td>
                </tr>
                
                <tr>
                  <th>模块名称：</th>
                  <td><input type="text" name="m" id="module" class="input length_3" value="<?php echo $node['m']; ?>"></td>
                </tr>
                <tr>
                  <th>操作名称：</th>
                  <td><input type="text" name="a" id="action" class="input length_3"></td>
                </tr>
                <tr>
                  <th>额外参数：</th>
                  <td>
                  <input type="text" name="param" id="param" class="input length_3">
                  <div class="fun_tips">参照(param1=100&amp;param2=abc)</div>
                  </td>
                </tr>
                <tr>
                  <th>显示状态：</th>
                  <td>
                  <?php foreach($show_status as $key => $val): ?>
                      <input type="radio" name="status" value="<?php echo $key; ?>" id="status<?php echo $key; ?>">
                      <label for="status<?php echo $key; ?>"><span><?php echo $val; ?></span></label>
                  <?php endforeach; ?>
                  </td>
                </tr>
                </table>
        </div>
        
    <div class="pop_bottom">
        <button class="btn fr" id="J_dialog_close" type="button">取消</button>
        <button type="submit" class="btn btn_submit mr10 fr J_ajax_submit_btn">提交</button>
    </div>
    
    </form>
</div>
</body>